package fr.n7.khome.view.renderer;

import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

import fr.n7.khome.model.LodgingType;
import fr.n7.khome.view.JRequestField;

public class LodgingTypeRenderer extends JRequestField implements TableCellRenderer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1362865233308854065L;

	public LodgingTypeRenderer() {
		super();
		setOpaque(true); //MUST do this for background to show up.
		setEnabled(true);
//		setHorizontalAlignment(JLabel.CENTER);
	}
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		if(value instanceof LodgingType) {
			LodgingType lt = (LodgingType)value;
			setText(lt.toString());
//			setToolTipText("");
		}
		return this;
	}
	
}
